﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;

public class EnemyPreviewerBehaviour : MonoBehaviour, IPointerClickHandler
{
    public GameObject belongEnemyObject;
    public void OnPointerClick(PointerEventData eventData)
    {
        if (belongEnemyObject)
        {
            SetLockTarget();
        }
    }

    void SetLockTarget()
    {
        GameObject.FindGameObjectWithTag(StaticDataManager.TARGET_GRID_TAG)
            .GetComponent<TargetLockGridBehaviour>()
            .LockTarget(belongEnemyObject);
    }
}
